package vip.specimen.system.datasource.validation;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;
import vip.specimen.system.datasource.validation.annotation.PermissionUuid;
import vip.specimen.system.datasource.validation.annotation.RoleCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Set;
import java.util.UUID;

/**
 * *@Author: 余浪人
 * *@Date：2021/3/22 14:26
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Getter
@Setter
public class SystemRoleValidation {
    @NotBlank(message = "角色名称不能为空")
    @Size(max = 200, message = "角色名称过长")
    private String roleName;
    @NotBlank(message = "角色标识不能为空")
    @Size(max = 200, message = "角色标识过长")
    @RoleCode
    @Pattern(regexp = "^[a-zA-Z]+$", message = "角色标识只能是纯字母")
    private String roleCode;
    @Size(max = 1024, message = "角色描述过长")
    private String roleDescription;
    @Range(min = 1, max = 3, message = "请选择合法的状态")
    private int roleStatus;
    @Size(max = 1024, message = "角色备注过长")
    private String roleRemark;
    @PermissionUuid
    private Set<UUID> permission;
}
